package alipay;
import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 */

public class AlipayConfig {
    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "9021000123609940";
    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDGl2AFDHS+Ieuvi4N74ue8sQwoku57/3OVRrfN7jB1US/DGPi1i+y+47YxjPOMen5XMsdAvEVmFuu0sYsPYrWEkY19rv/uEmWBOj5LgRfGX4rsj4QvCufF0vI5UBCnZI/8gThSK7hFZpZOI/Rw1cMnEFgH6ZF8ATzwcMWL6WlcnAKyKqo+B9+xDlUmdV81P9rnnvWYcDOFTYUMoLz3iqgNhmFFWw5utGzBYJl3QMbBAgjzchl8JiKuDTu4e94qbqkT+hB5R2mBZTo8/lmj5vVCZopsWtlBjWwVxTvHhgYyVY2liqQQ1bx11UYWUD/moKTE3uaEj1E0ZDPReHCVxcYLAgMBAAECggEBAJrKHnOQ8+XG9reLXN7RS6NNtJZjgDNyNxshVd7TSz4GG95Ltn97Ivre7oHMxYC3cYZx89DHbqhWMT5ULHm/jJBaCxjtsFpWSHvjc+7SHj/m9JfSfUtVirYs59Q4TeLLhVdhOQ8DOMwPXBRn/f19AHGQUa1JJrarGF6o57FYK2Gcb41hcwT1NrK6UYkhH195OTseKH8NFm8V8yXzI56xdviz61fG8/ccDx/kyjyU+1mkB45q25+nfez0gd9QIUChhGIRIrOjTUHbIQjD2I3X/aBNex3q4hDa5BOPH2Sl0P+AjkGs8UrEq/xNQNor76heqPVLnKeqV3j5gH8VzTdjGiECgYEA95NkdLpkN9lAGSGn2Y+saP5i0sHwoghMX84YI3ysO1bebF2An8bLLjI22pHOr81ACDt4YRdyUiFPFBfbUTAq9HiwX5PxUaRjLBh+590S6m6sU+OZ/sMee9sn0Yb02F0ssYg6GCSDCUXpKQced1vajCbkEpSV1xy9F12tc3bHfakCgYEAzVlIulQJ1TU0reJKPKpk4lambtjV9cIulsvl4Gye3q9x7AG2HB2INaYgXQirtnoKV/KMY1rVhkGeE6RtB3TAv6TkdC6a6tgBKzM3pHHrfS3cDc2m8aDl40wCTYRjKi15soR59QluKNLNL7w6tGyXuP84lykzkKr3qNAYGt+qbpMCgYEA7zNhY8aS/cLRw3ZZDkNaeTcPlEH9lRAfepFNkTvrzIlp7ZmJpNYViVTK2vL1l7XfoBSVgnl84w17shY6uH6pgfr5rd7q0c7aYshoFO3sUMUNix/ksdkjotdj6XVTK5kajYzpVFoyoMsDM7jFHt2IktEgmzMkcuo5aFICPAUPScECgYEAstZzVHMkLR8tRdKyPKtZORWl1RvbGzGGSaZCCXYP1niNirDi3RGLMs3/mYaXpVAb+gQu58iP9WDoPssQeVHhHAaLP/Pmz2hXfDwa1YixQk/SOeNE5WLvU0k7KC+H/Y+lUSe23wTbf4o3UL9pkQCSEneT3XHwiqmbDtZMZ/sq/ykCgYB4jGuDpYYK1R/pw6GfP9Ynvx0cuvDuM/F90h3jE5jGOS+z8L6takGjIlFx3z6sGTkzUfRL+d39mEkpc7EFLHM7iHDxy35OzydEMol/1zRVng+QZQEoyTAcEYzWLiuJTR2iuinQ+1zjdlI22qcUrQKZPjW7ut8yZFOPSI2Q+9SE7A==";
    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhDckj31RMxRXcwe9lzO46LDn1ek+u7YggmKCCwaKKyA7wlg5lESLasaBHk8AHapm0Gh7AiWuaRNHcHznLhmeggQYlG+1ff4hee7ZsP+qMh2fQNXbynRjZbclcqVvkqTC+q5ZqcjIzQrTOsQFyUOddmJD7nB+/oWHDPnb+Z88QAbqmf/mPPdx3R0no1vq13yTU88zQOb9SMl0WkLeWA9AWG073AaEvur3kNH0sp4nmbRZCEtkGnZtouPy2qrFAT5/yz9VJVZGNMgUTD2BdDE7dZS+mtrNJ+B3u+MG3dUlBGBBYSBeai+ttaJF5ixcUg53GgVdAv4a5V4qSMhXV8FlWQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "https://22909w733r.zicp.fun/NotifyCallBackServlet";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "https://22909w733r.zicp.fun/ReturnCallbackServlet";
    // 签名方式
    public static String sign_type = "RSA2";
    // 字符编码格式
    public static String charset = "utf-8";
    // 支付宝网关
    public static String gatewayUrl = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


    //↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

